<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			function Book(name, newPrice, oldPrice) {
				this.name = name
				this.newPrice = newPrice
				this.oldPrice = oldPrice
			}

			var book = {
				newPrice: 12,
				name: 'abc',
				oldPrice: 10,
			}

			console.log('book', book, book.name, book['newPrice'])

			var book1 = new Book('自身', 12, 10)
			console.log(book1)

			var age = 0
			var message = ''
			var isAdmin = false
			var book = null
			// var book = {}  当对一个对象类型进行初始化时, 不建议初始化{}, 建议初始化null
			if (book) {
				console.log('book')
			}

			console.log(typeof book)
		</script>
	</body>
</html>
